<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta content="yes" name="apple-mobile-web-app-capable">
        <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, target-densityDpi=device-dpi" />
        <!-- 微软的老式浏览器 -->
        <meta name="MobileOptimized" content="320">
        <!-- 启用360浏览器的极速模式(webkit) – -->
        <meta name="renderer" content="webkit">
        <!-- 避免IE使用兼容模式 -->
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <!-- 针对手持设备优化，主要是针对一些老的不识别viewport的浏览器，比如黑莓 -->
        <meta name="HandheldFriendly" content="true">
        <!-- uc强制竖屏 -->
        <meta name="screen-orientation" content="portrait">
        <!-- QQ强制竖屏 -->
        <meta name="x5-orientation" content="portrait">
        <!-- UC强制全屏 -->
        <meta name="full-screen" content="yes">
        <!-- QQ强制全屏 -->
        <meta name="x5-fullscreen" content="true">
        <!-- UC应用模式 若开启长按无法复制链接-->
        <!--meta name="browsermode" content="application"-->
        <!-- QQ应用模式 -->
        <meta name="x5-page-mode" content="app">
        <!--网站开启对web app程序的支持-->
        <meta name="apple-touch-fullscreen" content="yes">
        <!--在web app应用下状态条（屏幕顶部条）的颜色-->
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <!-- windows phone 点击无高光 -->
        <meta name="msapplication-tap-highlight" content="no">
        <!--移动web页面是否自动探测电话号码-->
        <!--<meta http-equiv="x-rim-auto-match" content="none">-->
        <!--手机号码显示为拨号链接-->
        <meta name="format-detection" content="telephone=no">
        <meta http-equiv="Cache-Control" content="max-age=300" />
        <meta http-equiv="Expires" content="300" />
        <title>投哪网-舆情解读</title>
        <link rel="stylesheet" href="../css/reset.css">
        <link rel="stylesheet" href="../css/opinion-comment.css">
        <link rel="stylesheet" href="../assets/swiper/css/swiper.min.css">
        <link rel="stylesheet" href="../assets/layer_mobile/need/layer.css">
        <script src="../assets/layer_mobile/layer.js"></script>
        <script src="../js/jquery.min.js"></script>
        <script src="../assets/swiper/js/swiper.jquery.min.js"></script>
        <script src="../js/common.js"></script>
    </head>
    <body>
    <div class="container">
      <div class="short-one">
          <div class="one-title">
            <h4>请选择您对平台的评价</h4>
          </div>
          <a class="one-have">
            <p>您已选择放心投，点击更改 > </p>
          </a>
        </div>
        <div class="opinion-detail">
          <ul>
            <li>
              <h4 class="opinion-href">舆情链接</h4>
              <input type="text"  placeholder="输入网址"/>
            </li>
            <li>
              <h4 class="opinion-form">舆情来源</h4>
              <input type="text"  placeholder="输入来源名字"/>
            </li>
            <li>
              <h4 class="opinion-title">舆情标题</h4>
              <input type="text"  placeholder="输入舆情标题"/>
            </li>
          </ul>
        </div>
        <div class="short-comment" id="wordCounta">
            <textarea class="comment-textarea" cols="5" type="text" maxlength="500" placeholder="说点什么呢..." ></textarea>
            <span class="wordWrap">
            <var class="word">200</var>/ 200
            </span>
          </div>
        <div class="submit">
        <p>提交</p>
      </div> 
    </div>
    <!-- 弹出层 -->
    <div class="popup">
      <div class="popup-com">
        <div class="popup-title">
          <p>请选择您对平台的评价</p>
        </div>
        <div class="popup-con">
          <ul class="clearfix" id="tag">
            <li>
              <div class="unchecked one">
                <p>推荐投</p>
              </div>
            </li>
            <li>
              <div class="unchecked two">
                <p>放心投</p>
              </div>
            </li>
            <li>
              <div class="unchecked three">
                <p>谨慎投</p>
              </div>
            </li>
            <li>
              <div class="unchecked four">
                <p>不要投</p>
              </div>
            </li>
          </ul>
        </div>
        <div class="popup-submit">
          <p>下一步</p>
        </div>
      </div>
    </div>
    <script type="text/javascript">
    $('.one-have').click(function() {
          $('.popup').css('display','block');
        });
        $('.popup-submit').click(function() { 
          var  text ='',temp = 0;
          $('#tag > li > div').each(function(index, v) {
            if($(v).hasClass('active')){
              temp +=1;
            }
            $('.one-have > p')[0].innerHTML = '您已选择'+text+'，点击更改 >';
          });
          if(temp>1){
            layer.open({
              content: '最多只能选择一个！'
              ,skin: 'msg'
              ,time: 2 //2秒后自动关闭
            });
          }else{
            $('.popup').css('display','none');
            $('#tag > li > div').each(function(index, v) {
              if($(v).hasClass('active')){
                text += $(v).children('0').prevObject["0"].innerText;
            }
           $('.one-have > p')[0].innerHTML = '您已选择'+text+'，点击更改 >';
          });
        }
        });
         // 点击评价
      $('#tag > li > div').each(function(index, v) {
        $(v).click(function(){
          if($(v).hasClass('active')){
            $(v).removeClass('active');
            console.log($(v).children('0'))
          }else{
            $(v).addClass('active');
          }
        });
      });
       $(function(){
        var wordCount = $("#wordCounta"),
            textArea = wordCount.find("textarea"),
            word = wordCount.find(".word");
        statInputNum(textArea,word);
    });
    function statInputNum(textArea,numItem) {
        var max = numItem.text(),
            curLength;
        textArea[0].setAttribute("maxlength", max);
        curLength = textArea.val().length;
        numItem.text(max - curLength);
        textArea.on('input propertychange', function () {
            var _value = $(this).val().replace(/\n/gi,"");
            numItem.text(max - _value.length);
        });
    }
    </script>
    </body>
</html>